<?php
/**
 * The template for displaying all pages
 *
 * This is the template that displays all pages by default.
 * Please note that this is the WordPress construct of pages and that
 * other 'pages' on your WordPress site will use a different template.
 *
 * @package WordPress
 * @subpackage Twenty_Fourteen
 * @since Twenty Fourteen 1.0
 */

get_header(); ?>
<div id="page" class="container">
	<div id="main">
<div id="main-content" class="main-content">
	<div class="row">
		<div class="col-md-9">

			<?php
				// Start the Loop.
				while ( have_posts() ) : the_post();

					// Include the page content template.
					get_template_part( 'content', 'page' );

				endwhile;
			?>

		</div><!-- #col right-->
		<div class="col-md-3 single-page">
			<div class="row">
				<div class="hot-news">
						<a class="arrow-left" href="#"></a> 
						<a class="arrow-right" href="#"></a>
						<div class="swiper-container-hotnews">
							<div class="swiper-wrapper hot-news">
								<?php query_posts(array('post__in'=>get_option('sticky_posts'), 'posts_per_page'=>1)); ?>
								<?php while (have_posts()) : the_post(); ?>
									<div class="new-product swiper-slide"> 
										<?php if ( has_post_thumbnail() ):the_post_thumbnail('home-thumnails'); else: ?>
										<img src="<?php echo get_template_directory_uri().'/images/no_image.jpg'?>" title="no image">
										<?php endif;?>
										<div class="new-product-short">
											<h4><?php the_title() ?></h4>
											<p>Mã số: <?php the_field('ma_tai_san') ?></p>
											<p>Vị trí: <?php the_field('vi_tri') ?></p>
											<p>Diện tích: <?php the_field('dien_tich') ?></p>
											<p>Giá:	<?php the_field('gia_khoi_điem') ?></p>
											<a href="<?php the_permalink(); ?>"><span>Chi tiết</span></a>
										</div>
									</div>
								<?php endwhile; ?>
								<?php wp_reset_query(); ?>
							</div>
						</div>
						<div class="pagination"></div>
					</div>
				<div class="news-wrapper">
					<div class="news">
						<p class="title">Tin Tức</p>
						<?php query_posts('posts_per_page=5&category_name=tin-tuc&orderby=desc'); ?>
						<?php if (have_posts()): while (have_posts()) : the_post(); ?>
						<div class="list-news">
							<a href="<?php the_permalink(); ?>" title="<?php the_title() ?>">
								<span><?php the_title() ?></span>
								<span class="timer"><?php the_time('j/n/Y') ?></span>
							</a>
						</div>
						<?php endwhile;else: ?>
						<!-- when no post -->
						<?php endif; ?>
						<?php wp_reset_query(); ?>
					</div>
				</div>
				<div class="partner-wrapper">
					<?php echo do_shortcode('[rsSlider id="79"]') ?>
				</div>
				<div class="reference-wrapper">
					<div class="reference">
						<p class="title">Liên Kết</p>
						<?php 
							$page_slug ='lien-ket';
							$page_data = get_page_by_path($page_slug);
							$page_id = $page_data->ID;
							echo apply_filters('the_content', $page_data->post_content); 
						?>
					</div>
				</div>
			</div>
		</div>
		
	</div><!-- #row -->
</div><!-- #main-content -->

<?php
get_footer();
